package jmine.tec.batch.domain;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Version;

import jmine.tec.persist.Versioned;
import jmine.tec.persist.annotation.Alias;
import jmine.tec.persist.annotation.DiscriminatorComment;
import bancosys.tec.component.Documentation;
import bancosys.tec.persist.bussobj.PersistableBusinessObject;

@Entity
@DiscriminatorValue(value = "MyCE")
@DiscriminatorComment("MY CONCURRENT ELEMENT")
@SequenceGenerator(name = "SEQ_MYELEM", sequenceName = "SEQ_MYELEM")
@Table(name = "MYELEMENT")
@Alias(value = "MYELEM")
@Documentation(value = "BLA BLA")
public class MyConcurrentElement extends PersistableBusinessObject implements Versioned {

    private Long id;

    private Long version = 0L;

    /**
     * @return the id
     */
    @Id
    @Documentation("BLA")
    @Column(name = "ELE_ID")
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_MYELEM")
    public Long getId() {
        return this.id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Version para lock otimista da carteira.
     * 
     * @return the version
     */
    @Version
    @Column(name = "VERSION")
    @Documentation("BLA")
    public Long getVersion() {
        return this.version;
    }

    /**
     * @param version the version to set
     */
    public void setVersion(Long version) {
        this.version = version;
    }

}
